package reduce.fz.com.reduce.activity;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import reduce.fz.com.reduce.R;
import reduce.fz.com.reduce.bean.User;
import reduce.fz.com.reduce.fragment.AttentionListFragment;
import reduce.fz.com.reduce.fragment.SocietyMemberFragment;
import reduce.fz.com.reduce.service.preference.UserPreference;

public class AttentionListActivity extends BaseToolBarActivity {
    private AttentionListFragment fragment;
    //0关注，1粉丝
    private int type = 0;
    private Long uid = 0l;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_attention_list);
        type = getIntent().getIntExtra("type", 0);
        if(type==0) setToolbarTitle("关注列表");
        else setToolbarTitle("粉丝列表");
        uid = getIntent().getLongExtra("uid", 0);
        attachFragment();
    }

    @Override
    public void initWidget() {
    }

    @Override
    public void initListener() {

    }

    public void attachFragment() {
        if(uid==null||uid==0)
            uid=UserPreference.getUser().uid;
        fragment = AttentionListFragment.create(type, uid);
        getSupportFragmentManager().beginTransaction().replace(R.id.main_container, fragment).commit();
    }


}
